Japanese Unexamined Patent Application Publication No. 2007-23486 describes a technique of forcibly stopping an operation, such as slewing and backward travelling, of an upper slewing body when an obstacle (including a person) is detected in a collision prevention area determined in the periphery of the upper slewing body.
In the technique described above, when an operation is forcibly stopped but a manipulation instructing the operation is still being input to a manipulation device, stopping of operation is cancelled and the operation restarts when an obstacle that has been detected in the collision prevention area temporarily exits the area (that is, when a person that has been in the collision prevention area temporarily exits the collision prevention area). When the operation restarts simply by the obstacle temporarily exiting the collision prevention area as described above, the operation cannot be stopped immediately when the obstacle reenters the collision prevention area. This may cause a portion of the upper slewing body colliding against the obstacle. Moreover, in a case where the device for detecting an obstacle is a millimeter-wave radar, an obstacle that is vertically out of the range of the radio wave emitted by the millimeter-wave radar cannot be detected. Therefore, when an obstacle, which is detected in the collision prevention area (within the range of the radio wave), falls down, it is determined that the obstacle has moved outside the collision prevention area. Then stopping of operation is cancelled, and the operation restarts. Restarting of the operation with the obstacle still staying in a place where collision against a portion of the upper slewing body might happen may result in collision between the obstacle and the portion of the upper slewing body.